<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>栏目编辑页面</title>
<link rel="stylesheet" href="${base}/css/channel/main.css" />
<link rel="stylesheet" href="${base}/css/validationEngine.jquery.css" type="text/css"/>
<script type="text/javascript" src="${base}/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="${base}/js/lhgdialog/lhgdialog.min.js?self=true"></script>
<script type="text/javascript" src="${base}/js/jquery.validationEngine.js"></script>
<script type="text/javascript" src="${base}/js/jquery.validationEngine-zh_CN.js"></script>
<script type="text/javascript" src="${base}/js/jquery.blockUI.js"></script>
<script type="text/javascript" src="${base}/js/jquery.form.js"></script>
<script type="text/javascript" src="${base}/js/channel/channel.js"></script>
<script type="text/javascript">
	var base = '${base}';
</script>
<script type="text/javascript" charset="utf-8">
    window.UEDITOR_HOME_URL = "${base}/ueditor/";  //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" src="${base}/ueditor/editor_config.js"></script>
<script type="text/javascript" src="${base}/ueditor/editor_all_min.js"></script>
<script type="text/javascript">
var channelId='${(channel.channelId)!}';
var isLastNode='${isLastNode!}';//标记是否是叶子节点，提供删除的判断操作 1:是
/**
 * 初始化表单验证
 */
$(function () {
	if(document.dataForm){
		$("#dataForm").validationEngine({
		onValidationComplete: function(form, status){
	        if (status == true) {                   
	            form.validationEngine('detach');
	            form.submit();
	       	 }else{
	       		 $.unblockUI();
	       	 }
			}       
		});
	};
});
</script>
</head>
<body>
<form action="${base!}/channel/update.htm" method="post" id="dataForm" name="dataForm">
<input type="hidden" name="channelId" id="channelId" value="${(channel.channelId)!}"/>
<input type="hidden" name="parentId" id="parentId" value="${(channel.parentId)!}"/>
<input type="hidden" name="isLastNode" id="isLastNode"/>
<input type="hidden" name="originalPosition" id="originalPosition" value="${(application.priority)!}"/>
<div class="titbg02">
<strong class="fl">栏目管理</strong>
<a  href="#" id="add_button" onclick="adjustChannel()"  class="fr"><img border="0" align="absmiddle" src="${base}/images/contentImage/lc.gif">&nbsp;调整栏目位置 &nbsp; &nbsp;</a>
	<a  href="#" id="add_button" onclick="add()"  class="fr"><img border="0" align="absmiddle" src="${base}/images/contentImage/addForCh.gif">&nbsp;新增 &nbsp; &nbsp;</a>
	<a  href="#" id="del_button" onclick="deleteChannel()" class="fr"><img border="0" align="absmiddle" src="${base}/images/contentImage/delForCh.gif">&nbsp;删除&nbsp; &nbsp;</a>
	<a  href="#" id="save_button" onclick="formSubmit()" class="fr" ><img border="0" align="absmiddle" src="${base}/images/common/diary.png">&nbsp;保存&nbsp; &nbsp;</a>
</div>
<table border="0" cellspacing="1" cellpadding="2" class="taball" >
<tbody>
<tr>
<th><span class="red">*</span>上级栏目:</th>
<td>
<#if channel.parentId?? && channel.parentId gt 0>
<input type="text" class="w150" value='${(pChannel.title)!}' readonly="readonly" disabled="disabled"/>
<#else>
<input type="text" class="w150" value="顶级栏目" readonly="readonly" disabled="disabled"/>
</#if>
</td>
<th>
<span class="red">*</span>栏目标题:
</th>
<td>
<input type="text" class="validate[required] w150" name="title" value='${(channel.title)!}'/>
</td>
</tr>
<tr>
<th><span class="red">*</span>栏目类别:</th>
<td colspan="1">
<select onchange="changeChannelType(this.value)" name="channelType" id="channelType">
<option value="1" <#if channel.channelType==1>selected</#if>>新闻</option>
<option value="2" <#if channel.channelType==2>selected</#if>>单页</option>
</select>
</td>
<th>栏目模板:</th>
<td colspan="1">
<select name="model">
</select>
</td>
</tr>
<tr>
<th>访问地址:</th>
<td colspan="1">
<input type="text" class="w150" value="${(channel.accessUrl)!}" name="accessUrl"/>
</td>
<th>首页版位:</th>
<td colspan="1">
<select name="priority">
<#if application?? && application.priority??>
<option value="0">无</option>
<option value="1" <#if application.priority==1>selected</#if>>1</option>
<option value="2" <#if application.priority==2>selected</#if>>2</option>
<option value="3" <#if application.priority==3>selected</#if>>3</option>
<option value="4" <#if application.priority==4>selected</#if>>4</option>
<option value="5" <#if application.priority==5>selected</#if>>5</option>
<option value="6" <#if application.priority==6>selected</#if>>6</option>
<option value="7" <#if application.priority==7>selected</#if>>7</option>
<option value="8" <#if application.priority==8>selected</#if>>8</option>
<option value="9" <#if application.priority==9>selected</#if>>9</option>
<option value="10" <#if application.priority==10>selected</#if>>10</option>
<#else>
<option value="0" selected="selected">无</option>
<option value="1" >1</option>
<option value="2" >2</option>
<option value="3" >3</option>
<option value="4" >4</option>
<option value="5" >5</option>
<option value="6" >6</option>
<option value="7" >7</option>
<option value="8" >8</option>
<option value="9" >9</option>
<option value="10">10</option>
</#if>
</select>
</td>
</tr>
<tr id="txt_tr_id" <#if channel.channelType?? && channel.channelType==2><#else> style="display: none"</#if>>
	<th>栏目内容:</th>
	<td  colspan='3'>			
	<#if channel?? && channel.txt??> 
	<textarea  name="txt" id = "ueditTxt"  >${(channel.txt)!}</textarea>
	<script type="text/javascript">
			var editor = new UE.ui.Editor({ initialFrameWidth:640 , minFrameHeight:200  });
 					        editor.render("ueditTxt");
	</script>
	<#else>
	<textarea  name="txt" id = "ueditTxt"  ></textarea>
	<script type="text/javascript">
			var editor = new UE.ui.Editor({ initialFrameWidth:640 , minFrameHeight:200  });
 					        editor.render("ueditTxt");
			editor.ready(function(){//需要ready后执行，否则可能报错
				    editor.setContent("");
			})
	</script>
	</#if>			
	</td>
</tr>
</tbody></table>
</form>
</body>
</html>